package br.com.verde.exemploteca.underscore

object ReduceLeft {
  def main(args : Array[String]) : Unit = {
    val numbers = Array(1, 2, 3, 4, 5)
    // val sum = numbers.reduceLeft((a:Int, b:Int) => a + b) // It's same that below
    val sum = numbers.reduceLeft[Int](_ + _)
    
    println("The sum of the numbers one through five is " + sum)
  }
}
	